﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace TaskManagement.ModelLayer
{
    public class Task
    {
        public int Id { get; set; }
        public string Description { get; set; }
        public string Delivery { get; set; }
        public string Account { get; set; }
        public string Tag { get; set; }
        public string Status { get; set; }
        [Browsable(false)]
        public Employee Employee { get; set; }
        public string AssignedTo
        {
            get
            {
                if (Employee != null)
                    return Employee.FirstName + " " + Employee.LastName;
                else
                    return "";
            }
        }
        [Browsable(false)]
        public Workflow workflow { get; set; }
        public string PartOf
        {
            get
            {
                if (workflow != null)
                    return workflow.Name;
                else
                    return "";
            }
        }
        
        public DateTime? Date { get; set; } 
        public int Estiamte { get; set; }
        public int TimeSpent { get; set; }
        public IList<Task> Predecessors { get; set; }
        public IList<Task> Successors { get; set; }

        public Task()
        {
            this.Predecessors = new List<Task>();
            this.Successors = new List<Task>();
            this.Estiamte = -1;
            this.TimeSpent = -1;
        }

    }
}
